﻿<?xml version="1.0" encoding="utf-8" ?>

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly ="monitor_2_DBwork" namespace ="monitor_2_DBwork" >
  <class name="ServerLog" table="ServerLog" >
    <id name ="Id" column ="Id" type ="int" generator="identity"/>
    <property name="Login" column="Login" type="string(45)"/>
    <!--<property name="Access" column="Access" type="string(2)"/>-->
    <property name="Idaccess" column="Idaccess" type="int" not-null="false"/>
    <property name="Idobl" column="Idobl" type="int" not-null="false"/>
    <property name="Idcategory" column="Idcategory" type="int"/>
    <property name="Name" column="Event" type ="string"/>
    <property name="Date" column="Date" type="DateTime"/>

    <many-to-one name="CategoryType" class="Category" lazy="false" column="Idcategory"
                 cascade="save-update" insert="false" update="false" not-null="false"/>
    
    <many-to-one name="AccessType" class="Access" lazy="false" column="Idaccess"
                 cascade="save-update" insert="false" update="false" not-null="false"/>
    
    <many-to-one name="Oblast" class="Oblast" lazy="false" column="Idobl"
                 cascade="save-update" insert="false" update="false" not-null="false"/>

  </class>
</hibernate-mapping>